<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>WebView测试</title>
</head>
<body>
<h1>我是第二页</h1>
<button id="test">测试事件</button>
<a href="index1.html">
    <h2>第一页</h2>
</a>


</body>

<script type="text/javascript">
    document.getElementById('test').onclick = function(){

        alert("click");

        var command = {
            'action': 'test',
            'data': '这是测试数据'
        };
        if(window.latte){
            latte.event(JSON.stringify(command));
        }else{
            alert("latte ont found")
        }
    }

    var nativeCall = function(){
        alert("原生调用了");
    }
</script>

</html>